class User < ApplicationRecord

  validates :name, presence: {message: "用户名不能为空"}
  validates :name, uniqueness: {message: "用户名已存在"}
  validates :password, presence: {message: "密码不能为空"}
  validates :password, length: {minimum: 6, message: "密码长度最短为6位"}

end
